﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/INFTUR.Master" CodeBehind="ManterHospedagem.aspx.cs" Inherits="INFTUR.WebForm2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div style="width:400px">
      
     <div style="width:400px"> 
       
         <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
             DataSourceID="ObjectDataSource2" Width="388px">
             <Columns>
                 <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" />
                 <asp:BoundField DataField="Cliente" HeaderText="Cliente" 
                     SortExpression="Cliente" />
                 <asp:BoundField DataField="Preco" HeaderText="Preco" SortExpression="Preco" />
                 <asp:BoundField DataField="Data_entrada" HeaderText="Data_entrada" 
                     SortExpression="Data_entrada" />
                 <asp:BoundField DataField="Data_saida" HeaderText="Data_saida" 
                     SortExpression="Data_saida" />
                 <asp:BoundField DataField="Quarto" HeaderText="Quarto" 
                     SortExpression="Quarto" />
                 <asp:TemplateField HeaderText="Atualizar">
                     <ItemTemplate>
                         <asp:LinkButton ID="lbAtualizar" runat="server" onclick="lbAtualizar_Click">Atualizar</asp:LinkButton>
                     </ItemTemplate>
                 </asp:TemplateField>
                 <asp:TemplateField HeaderText="Remover">
                     <ItemTemplate>
                         <asp:LinkButton ID="lbRemover" runat="server" onclick="lbRemover_Click">Remover</asp:LinkButton>
                     </ItemTemplate>
                 </asp:TemplateField>
             </Columns>
         </asp:GridView>
         <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
             DataObjectTypeName="Negocios.VendaHospedagemBO" DeleteMethod="remover" 
             InsertMethod="inserir" OldValuesParameterFormatString="original_{0}" 
             SelectMethod="ConsultaTodos" TypeName="Negocios.VendaHospedagemBOMetodos" 
             UpdateMethod="atualizar">
             <DeleteParameters>
                 <asp:Parameter Name="id" Type="Int32" />
             </DeleteParameters>
         </asp:ObjectDataSource>
       
     </div>
     <div id="cadastro" style="width:400px" class="divDados">
     
         <table class="style1">
             <tr>
                 <td>
                     <asp:Label ID="lbId" runat="server" Text="ID"></asp:Label>
                 </td>
                 <td>
                     <asp:TextBox ID="tbId" runat="server"></asp:TextBox>
                     <asp:Button ID="btNovo" runat="server" onclick="btNovo_Click" Text="Novo" 
                         Width="67px" />
                 </td>
             </tr>
             <tr>
                 <td>
                     <asp:Label ID="lbCliente" runat="server" Text="Cliente"></asp:Label>
                 </td>
                 <td>
                     <asp:DropDownList ID="ddlCliente" runat="server" AppendDataBoundItems="True" 
                         DataSourceID="ObjectDataSource3" DataTextField="Nome" DataValueField="Cpf">
                         <asp:ListItem Value="0">Selecione Clientes</asp:ListItem>
                     </asp:DropDownList>
                     <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" 
                         DataObjectTypeName="Negocios.ClienteBO" DeleteMethod="Remove" 
                         InsertMethod="Insere" OldValuesParameterFormatString="original_{0}" 
                         SelectMethod="ConsultaTodos" TypeName="Negocios.ClienteBOMetodos" 
                         UpdateMethod="Atualiza">
                         <DeleteParameters>
                             <asp:Parameter Name="cpf" Type="String" />
                         </DeleteParameters>
                     </asp:ObjectDataSource>
                 </td>
             </tr>
             <tr>
                 <td>
                     <asp:Label ID="lbPreco" runat="server" Text="Preço"></asp:Label>
                 </td>
                 <td>
                     <asp:TextBox ID="tbPreco" runat="server"></asp:TextBox>
                 </td>
             </tr>
             <tr>
                 <td>
                     <asp:Label ID="lbHotel" runat="server" Text="Hotel"></asp:Label>
                 </td>
                 <td>
                     <asp:DropDownList ID="ddlHotel" runat="server" AppendDataBoundItems="True" 
                         DataSourceID="ObjectDataSource4" DataTextField="Nome" DataValueField="Id">
                         <asp:ListItem Value="0">Selecione o Hotel</asp:ListItem>
                     </asp:DropDownList>
                     <asp:ObjectDataSource ID="ObjectDataSource4" runat="server" 
                         DataObjectTypeName="Negocios.HotelBO" DeleteMethod="remover" 
                         InsertMethod="inserir" OldValuesParameterFormatString="original_{0}" 
                         SelectMethod="ConsultaTodos" TypeName="Negocios.HotelBOMetodos" 
                         UpdateMethod="atualizar">
                         <DeleteParameters>
                             <asp:Parameter Name="id" Type="Int32" />
                         </DeleteParameters>
                     </asp:ObjectDataSource>
                 </td>
             </tr>
             <tr>
                 <td>
                     <asp:Label ID="lbData_Entrada" runat="server" Text="Data de Entrada"></asp:Label>
                 </td>
                 <td>
                     <asp:TextBox ID="tbData_Entrada" runat="server"></asp:TextBox>
                 </td>
             </tr>
             <tr>
                 <td>
                     <asp:Label ID="lbData_Saida" runat="server" Text="Data de Saida"></asp:Label>
                 </td>
                 <td>
                     <asp:TextBox ID="tbData_Saida" runat="server"></asp:TextBox>
                 </td>
             </tr>
             <tr>
                 <td>
                     <asp:Label ID="lbQuarto" runat="server" Text="Quarto"></asp:Label>
                 </td>
                 <td>
                     <asp:TextBox ID="tbQuarto" runat="server"></asp:TextBox>
                 </td>
             </tr>
             <tr>
                 <td>
                     <asp:Button ID="btGravar" runat="server" onclick="btGravar_Click" 
                         Text="Gravar" Enabled="False" />
                     <asp:Button ID="btCancelar" runat="server" Text="Cancelar" Enabled="False" />
                 </td>
                 <td>
                     &nbsp;</td>
             </tr>
         </table>
     
     </div>
    </div>
    <asp:Label ID="Lberro" runat="server"></asp:Label>
</asp:Content>